<template>
	<!-- 底部弹出框部分 -->
	<view class="popup" v-if="value">
		<view class="popupFlex">
			<view class="popupFlex-top-box">
				<view class="title">
					请选择售后类型
				</view>
				<view class="close-icon-box" @click="handleShowAfterSales">
					<image src="@/static/img/del.png" mode="aspectFit"></image>
				</view>
			</view>

			<view class="commodity">
				<image :src="goodsInfo.original_img"></image>
				<view class="text">
					<view>
						<view class="name">{{goodsInfo.goods_name}}</view>
						<!-- <view class="spec">{{goodsInfo.spec_key_name}}</view> -->
					</view>
					<view class="spec2">单价
						￥{{goodsInfo.goods_price}}<text>数量{{goodsInfo.goods_num}}</text>
					</view>
				</view>
			</view>
			<view class="model" @click="$navTo('pages/mines/after_sales', {orderId: goodsInfo.order_id, refundType: 1})">
				<view class="left">
					<image src="@/static/img/tuiicon.png"></image>
					<view>退款</view>
				</view>
				<view class="right">
					<view>商品未收到货退款</view>
					<image src="@/static/img/righticon.png"></image>
				</view>
			</view>
			<!-- 	<view class="model"
					@click="$navTo('pages/mines/after_sales', {orderId: goodsInfo.order_id, refundType: 3, mode: 'create'})">
					<view class="left">
						<image src="@/static/img/huanicon.png"></image>
						<view>换货</view>
					</view>
					<view class="right">
						<view>退换您收到的商品</view>
						<image src="@/static/img/righticon.png"></image>
					</view>
				</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		// 售后弹窗
		name: 'AfterSalePopup',
		props: {
			// 展示
			value: {
				type: Boolean,
				default: false
			},
			// 商品详情
			goodsInfo: {
				type: Object,
				default: {}
			}
		},
		emits: ['input'],
		data() {
			return {
				show: false,
			}
		},
		watch: {
			value: {
				handler(nVal) {},
				immediate: true
			}
		},
		methods: {
			handleShowAfterSales() {
				this.$emit('input', !this.value)
			},
		}
	}
</script>

<style lang="scss" scoped>
	// 底部弹出框部分
	.popup {
		position: fixed;
		top: 0;
		right: 0;
		left: 0;
		bottom: 0;
		background-color: rgba(0, 0, 0, 0.5);
		display: flex;
		flex-direction: column-reverse;

		.popupFlex {
			height: 894rpx;
			border-radius: 20rpx 20rpx 0 0;
			background: #fff;
			padding: 0rpx 30rpx;

			.popupFlex-top-box {
				display: flex;
				align-items: center;

				.title {
					flex: 1;
					font-weight: bold;
					font-size: 30rpx;
					color: #1e1e1e;
					text-align: center;
					padding: 24rpx 0rpx;
				}

				.close-icon-box {
					display: flex;
					justify-content: center;
					align-items: center;
					padding-left: 30rpx;
					width: 30rpx;
					height: 30rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}
			}

			.commodity {
				display: flex;
				align-items: center;

				image {
					width: 170rpx;
					height: 170rpx;
					border-radius: 6rpx;
					margin-right: 20rpx;
				}

				.text {
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					height: 170rpx;

					.name {
						font-weight: 400;
						font-size: 26rpx;
						color: #1e1e1e;
					}

					.spec {
						font-weight: 400;
						font-size: 24rpx;
						color: #7e7e7e;
					}

					.spec2 {
						font-weight: 400;
						font-size: 24rpx;
						color: #1e1e1e;

						text {
							padding-left: 20rpx;
						}
					}
				}
			}

			.model {
				height: 100rpx;
				border-radius: 15rpx;
				background: #f5f5f5;
				margin-top: 40rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 0rpx 20rpx;

				.left {
					display: flex;
					align-items: center;

					image {
						width: 60rpx;
						height: 56rpx;
						margin-right: 10rpx;
					}

					view {
						font-weight: 400;
						font-size: 40rpx;
						color: #1e1e1e;
					}
				}

				.right {
					display: flex;
					align-items: center;

					image {
						width: 25rpx;
						height: 25rpx;
					}

					view {
						font-weight: 400;
						font-size: 24rpx;
						color: #7e7e7e;
						margin-right: 10rpx;
					}
				}
			}
		}
	}
</style>